<include file="Public/header" />
<title>我的桌面</title>
</head>
<body>
<div class="page-container">
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
            <input type="text" name="name" id="name" value="<{$Think.get.name}>" placeholder=" 仓库名称" style="width:250px" class="input-text">
        <button name="" id="search" class="btn btn-success" type="submit"><i class="Hui-iconfont"></i> 搜索</button>
        </span>
        <span class="r">共有数据：<strong><{$count}></strong> 条</span>
    </div>
    <div class="mt-20">
        <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper no-footer">
            <table class="table table-border table-bordered table-bg table-hover table-sort dataTable no-footer" id="DataTables_Table_0" role="grid" aria-describedby="DataTables_Table_0_info">
            <thead>
            <tr class="text-c" role="row">
                <th width="80" class="sorting_desc" tabindex="id" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="descending" style="width: 80px;">ID</th>
                <th class="sorting" tabindex="name" style="width: 487px;">仓库名称</th>
                <th class="sorting" tabindex="warehouse_code" width="80" style="width: 180px;">仓库编码</th>
                <th width="120" style="width: 120px;">添加时间</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="data">
            <tr class="text-c odd" role="row">
                <td class="sorting_1"><{$data.id}></td>
                <td class="text-l"><span style="cursor:pointer" class="text-primary" title="查看"><{$data.name}></span></td>
                <td><{$data.warehouse_code}></td>
                <td><{$data.created_at}></td>
            </tr>
            </foreach>
            </tbody>
        </table>
            <div class="page">
                <{$page}>
            </div>
    </div>
</div>
    </div>
<include file="Public/footer" />
<include file="Public/footer_js" />
<script>
    $("#search").click(function (){
        search();
    });
    function search(_this){
        var sort,dec;
        if(_this){
            if(_this.attr('class')=='sorting_desc'){
                sort=_this.attr('tabindex');
                dec='asc';
            }
            if(_this.attr('class')=='sorting_asc'){
                sort=_this.attr('tabindex');
                dec='desc';
            }
            if(_this.attr('class')=='sorting'){
                sort=_this.attr('tabindex');
                dec='asc';
            }
        }else{
            sort='';
            dec='';
        }
        var name=$("input[name=name]").val();
        location.href="__ACTION__?name="+name+"&sort="+sort+"&dec="+dec;
    }
    (function(){
        $(".sorting,.sorting_desc,.sorting_asc").click(function (){
            search($(this));
        });
        for(var i=0;i<$(".sorting,.sorting_desc,.sorting_asc").length;i++){
            if('<{$Think.get.sort}>'!=''){
                if($(".sorting,.sorting_desc,.sorting_asc").eq(i).attr('tabindex')=='<{$Think.get.sort}>'){
                    $(".sorting,.sorting_desc,.sorting_asc").attr('class','sorting');
                    $(".sorting,.sorting_desc,.sorting_asc").eq(i).attr('class','sorting_<{$Think.get.dec}>');
                }
            }
        }
    })();
</script>
</body>
</html>